//client里面挂1个t1,挂的时候写var
var fs = require('fs');

function testcase() {

    setTimeout(function case1() {
            var t1 = new Date().getTime(); //单位毫秒
//在(status == 200)下面挂1个
            //console.log(t1)

            for (var i = 0; i < 50000; i++) {
                var t2 = new Date().getTime();
                //console.log(t2)
            }
            var t3 = t2 - t1;
            console.log("case1", t3);//读取到回包的毫秒

            var timeArr = [];
            timeArr.push(t3);
            console.log(timeArr);//这里有问题写入的单个的。node.js语法不熟
            //写在client里
            fs.writeFile("Time.json", timeArr, function (err) {
                if (err) throw err;
            });
        },1000
    );
    return 1;
}
for (num =0;num<5;num++){
    testcase();
}

//取中间的 原则是奇数中间取整，从前往后排
var arr = [12,21,3,5,12,5,3,6,21,6,2,6,71,5,19,6,8,54,3,6,8];
arr.sort(function(a,b){return b-a});
console.log(arr);
//根据长度定位
for (var t =0;t<arr.length;t++){
    var mid=arr[(Math.floor(arr.length/2))]
}
console.log(mid);